package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.*;
import com.lyf.scm.admin.api.dto.es.SalesPlanEsEntity;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * 销售计划Es查询通用解决方案远程接口
 *
 * @author wangchlei
 * @date 2020/10/26
 */
@FeignClient(name = "scm-plan-service")
public interface SalesPlanEsRemote {
    @PostMapping("/api/v1/salesPlanES/queryByGroup")
    Response<PageInfo<EsReturnDTO>> queryByGroup(@RequestBody EsAggregationDTO esAggregation);

    /**
     * 分页查询
     * @param esQuery
     * @param pageNum
     * @param pageSize
     * @return
     */
    @PostMapping("/api/v1/salesPlanES/listPageQuery")
    Response<List<SalesPlanEsEntity>> listPageQuery(@RequestBody EsQueryDTO esQuery,
                                                    @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize);


    @PostMapping("/api/v1/salesPlanES/exportByGroup")
    Response<EsScrollReturnDTO> exportByGroup(@RequestBody EsExportAggregationDTO esExportAggregationDTO);
}
